module UsersHelper
  
  def default_user_picture_url
    image_path("profile_picture.gif")
    
    #if @facebook_user
    #  return @facebook_user.pic_small 
    #else
    #  return image_path("profile_picture.gif")
    #end
  end
  
  def user_name(user)
    if user.facebook?
      return fb_name(user.fb_uid)
    else
      return user.full_name
    end
  end
  
  def current_user_name(hide_if_facebook=false)  
    user_name(@current_user) unless !@current_user or (hide_if_facebook and @current_user.facebook?)
  end
  
  def current_user_picture
    if @current_user
      if !@current_user.facebook?
        image_tag(default_user_picture_url)
      elsif facebook_session_secured?
        fb_profile_pic(facebook_user.uid,{:facebook_logo=>"true"})
      end
    end
  end
 
  def user_picture(user, options ={})
    if user.facebook?
      return fb_profile_pic(user.fb_uid,options) 
    else
      return image_tag("profile_picture.gif")
    end
  end
end
